﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SAM.Framework.Utils;
using SAM.Framework.Log;
using SAM.Framework.Log4netAdapter;

namespace WFApp.LogTest
{

    public partial class Form1 : Form
    {
        private ILog<NormMessage> log;

        public Form1()
        {
            Utils.AllocConsole();
            Console.WriteLine("程序启动");
            InitializeComponent();
            var ilog = log4net.LogManager.GetLogger("logtest");
            this.log = new DefaultLog4net<NormMessage>(ilog);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.log.Debug(new NormMessage()
            {
                Content = "启动"
            });
        }
    }
    public class NormMessage : AbstractLogMessage
    {
        public override string ToString()
        {
            return this.Content;
        }
    }
}
